package main

import (
	"ginDev/controllers"
	"ginDev/frans"
	"ginDev/middleware"
)

func main() {

	//无DB版本
	/*
		frans.Fighting().
			Onion(middleware.NewUserMiddleware()).
			Action("v1",
				controllers.NewMainController(),
				controllers.NewIndexController(),
				controllers.NewUserController(),
			).Start()
	*/

	//有DB版本
	frans.Fighting().
		DB(frans.NewGormAdapter()).
		Onion(middleware.NewUserMiddleware()).
		Action("v1",
			controllers.NewMainController(),
			controllers.NewIndexController(),
			controllers.NewUserController(),
			controllers.NewArticleController(),
		).Start()

	//有DB版本 可切换ORM
	/*frans.Fighting().
	Beans(frans.NewGormAdapter(), frans.NewXormAdapter()).
	Onion(middleware.NewUserMiddleware()).
	Action("v1",
		controllers.NewMainController(),
		controllers.NewIndexController(),
		controllers.NewUserController(),
	).Start()*/

}
